//
//  NetworkPath.h
//  freeRide
//
//  Created by HuangSui on 2017/4/4.
//  Copyright © 2017年 SuiXun. All rights reserved.
//


#import "Masonry.h"
#import "AFNetworking.h"
#import <SDWebImage/UIImageView+WebCache.h>
#import "NSString+Util.h"
#import "UIColor+GColor.h"
#import "UIButton+ImageTitleSpacing.h"
#import "AppDelegate.h"



typedef void(^RequestSuccess) (NSURLResponse *response, id responseObject);
typedef void(^RequestFailed) (NSError * error);






@interface NetworkPath : NSObject
//NS_ENUM，定义状态等普通枚举
typedef NS_ENUM(NSInteger, TTGState)
{
    TTGStateGet = 0,
    TTGStatePost,
    TTGStateJson,
};
//NS_OPTIONS
typedef NS_OPTIONS(NSUInteger, Test) {
    
    TestA = 1, //1 1 1等于号后面必须等于1
    
    TestB = 1 << 1, //2 2 10 转换成 10进制 2
    
    TestC = 1 << 2, //4 3 100 转换成 10进制 4
    
    TestD = 1 << 3, //8 4 1000 转换成 10进制 8
    
    TestE = 1 << 4 //16 5 10000 转换成 10进制 16
    
};


//导航左边按钮
+(UIButton *)SetNavLeftBtnWithController:(UIViewController *)vc withTitle:(NSString *)Btntext andImageName:(NSString *)imageName;
//导航右边按钮
+(UIButton *)SetNavRightBtnWithController:(UIViewController *)vc withTitle:(NSString *)Btntext andImageName:(NSString *)imageName;

//纯色图片
+ (UIImage*)createImageWithColor:(UIColor*)color;
//空数据替换
+ (id)replaceNullData:(id)obj;



+(void)leaveVC;


//下载
+(void)DownloadTask;
//上传
+(void)UploadTask;
//AF混合数据
+(void)MultiPartRequest:(NSString *)URLString andParameters:(NSDictionary*)parameters andValueFilePathWithKeyFileName:(NSDictionary *)fileDic RequestSuccess:(RequestSuccess)requestSuccess RequestFailed:(RequestFailed)requestFailed;
//AF数据请求
+(void)requestWithMethod:(TTGState)type andURLString:(NSString *)URLString andParameters:(NSDictionary*)parameters RequestSuccess:(RequestSuccess)requestSuccess RequestFailed:(RequestFailed)requestFailed;

//从对象取值
+(NSString *)getValue:(NSString *)key from:(id)object;
//判断字典
+(BOOL)isDictionary:(NSString *)key from:(id)object;
//判断数组
+(BOOL)isNSArray:(NSString *)key from:(id)object;
//取字典
+(NSDictionary *)GetDictionary:(NSString *)key from:(id)object;
//取数组
+(NSArray *)GetNSArray:(NSString *)key from:(id)object;

+(NSMutableAttributedString *)setRichText:(NSString *)str0 withFont:(CGFloat) size0 withColor:(UIColor *)color0 andOtherText:(NSString *)str1 withFont:(CGFloat) size1 withColor:(UIColor *)color1 atIndex:(NSUInteger)loc;


@end
